import express from 'express'
import router from './router'
import { networkInterfaces } from 'os';
const app = express();
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use("/favicon.ico", () => true);
app.use(express.static("src/assets"));
// 安装系统 
app.use(router);
app.listen(3000, "0.0.0.0", () => {
  console.log("server:");
  JSON.stringify(networkInterfaces(), (a, b) => {
    if (b.family && b.family === "IPv4") {
      console.log('\x1B[36m%s\x1B[0m', "       http://" + b.address + ":" + 3000);
    }
    return b;
  });
});